<template>
  <div>
    <h2>child子组件</h2>
    <p>父组件传递过来的值：{{msg}}</p>
    <el-button type="primary" @click="tofather">传值给父组件</el-button>
  </div>
</template>
<script>
export default {
  name: "child",
  props: ["msg"],
  data() {
    return {
      childmsg: "childData"
    };
  },
  methods: {
    tofather() {
      this.$emit("aaa", this.childmsg);
    }
  }
};
</script>
<style>
</style>;
